package com.mszl.blog.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mszl.blog.dao.dos.Archives;
import com.mszl.blog.dao.pojo.Article;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    List<Archives> listArchives();

    IPage<Article> listArticle(Page<Article> page, Long categoryId, Long tagId, String year, String month);

    @Update("update ms_article set view_counts=#{count} WHERE id = #{id}")
    void updateView(Long id,Double count);
    @Update("update ms_article set comment_counts=#{count} WHERE id = #{id}")
    void updateComment(Long id, Double count);

    //void incrComment(Long articleId);
}
